{extend name='main'}

{block name="button"}
{if auth("add")}
<button data-modal='{:url("add")}?type={:input("get.type")}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
{/if}

{/block}

{block name="content"}
<div class="think-box-shadow">
    <ul class="layui-tab-title">
        {foreach ['face_data'=>'人脸识别','device_status'=>'设备状态'] as $k=>$v}
        {if isset($type) and $type eq $k}
        <li class="layui-this" data-open="{:url('index')}?type={$k}">{$v}</li>
        {else}
        <li data-open="{:url('index')}?type={$k}">{$v}</li>
        {/if}
        {/foreach}
    </ul>
    <table class="layui-table" lay-even>
        <tbody>
        <tr>
            <td class="text-left"><b>字段</b></td>
            <td class="text-left"><b>说明</b></td>
            <td class="text-center"><b>操作</b></td>
        </tr>
        {foreach $list as $key => $vo}
        <tr>
            <td class="text-left"><b>{$vo.field|default='字段'}</b>
            <td class="text-left">{$vo.explain|default='说明'}</td>
            <td class="text-center">
                <a data-dbclick class="layui-btn layui-btn-xs" data-title="编辑" data-modal='{:url("edit")}?id={$vo.id}&type={:input("get.type")}'>编 辑</a>
                <a class="layui-btn layui-btn-danger layui-btn-xs" data-confirm="确定要删除吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
</div>
{/block}